#include<stdio.h>

int main()
{
    int i,x,y,last=1;
    printf("Input X的Y次方:");
    scanf("%d  %d",&x,&y);
    for(i=0;i<y;i++)
    {
        last=last*x%1000;
    }
            printf("The last number is: %d\n",last);
}